﻿using Microsoft.VisualStudio.Debugger.Interop;
using Red.Scripts.Debugger.Defines;

namespace Red.Scripts.Debugger.Remote.Debugger.ExpressionEvaluation
{
    internal class StackContext : IDebugExpressionContext2
    {
        #region Private Data

        StackFrame _frame;

        #endregion Private Data

        #region C-Tor

        public StackContext( StackFrame frame )
        {
            _frame = frame;
        }

        #endregion C-Tor

        #region IDebugExpressionContext2

        int IDebugExpressionContext2.GetName( out string pbstrName )
        {
            throw new System.NotImplementedException();
        }

        int IDebugExpressionContext2.ParseText( string pszCode, enum_PARSEFLAGS dwFlags, uint nRadix, out IDebugExpression2 ppExpr, out string pbstrError, out uint pichError )
        {
            pbstrError = null;
            pichError = 0;

            ppExpr = new Expression( _frame, pszCode );

            return Constants.S_OK;
        }

        #endregion IDebugExpressionContext2
    }
}
